﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Evaluant.PS4VS.Language.Expressions
{
    public class BinaryExpression : NaryExpression
    {
        protected BinaryExpression()
            : base(2)
        {
        }

        public BinaryExpression(IAAST left, BinaryExpressionType type, IAAST right)
            : this()
        {
            Left = left;
            Type = type;
            Right = right;
        }

        public IAAST Left
        {
            get { return (IAAST)expressions[0]; }
            set { expressions[0] = value; }
        }

        public IAAST Right
        {
            get { return (IAAST)expressions[1]; }
            set { expressions[1] = value; }
        }

        public BinaryExpressionType Type
        {
            get;
            protected set;
        }

        #region IAAST Members

        public override ExpressionType ExpressionType
        {
            get { return ExpressionType.Binary; }
        }

        #endregion
    }
}
